{template header}


<div class="container">

    <div class="row">
        <div class="col-md-8">
        <div class="panel panel-default">
            <div class="panel-body">
                <ul class="nav nav-tabs" role="tablist">
                    <li role="presentation"><a href="{tsUrl('duty','',null)}">记录</a></li>
                    <li role="presentation"><a href="{tsUrl('duty','order',null)}">排班</a></li>
                    <li role="presentation" class="active" ><a  href="{tsUrl('duty','sum',array('begintime'=>date('Y-m-d',strtotime('-1 month'))))}">统计</a></li>
                    <li style="float: right">
                        <a  class="btn btn-block" onclick="openform()"><i class="fa fa-filter"></i></a>
                    </li>
                </ul>

                <form id="selectform" class="searchform" method="get" action="{tsUrl('duty','sum',array('page'=>$page))}"  enctype="multipart/form-data" style="display: none;">
                     <ul style="padding:10px;display: flex">
                            <input type="hidden" name="app" value="duty">
                            <input type="hidden" name="ac" value="sum">
                            <input type="hidden" name="page" value="{$page}">
                           <input type="hidden" name="groupid" value="{$groupid}">
                           <input type="hidden" name="orgid" value="{$orgid}">

                           <li style="padding-right: 2px">
                               <select onChange="MM_jumpMenu('parent',this,0)" style="font-size:10px;font-weight: 300;"  class="form-control">
                                   <option value="{tsUrl('duty','sum',array('orgid'=>$orgid,'begintime'=>$begintime,'endtime'=>$endtime,'addyear'=>$addyear,'page'=>$page))}">全体</option>
                                   {loop $strGroup $key $item}
                                   <option value="{tsUrl('duty','sum',array('groupid'=>$item['groupid'],'orgid'=>$orgid,'begintime'=>$begintime,'endtime'=>$endtime,'addyear'=>$addyear,'page'=>$page))}" {if $groupid==$item['groupid']}selected{/if}>{$item['groupname']}</option>
                                   {/loop}
                               </select>
                           </li>

                           <li style="padding-right: 2px">
                               <select onChange="MM_jumpMenu('parent',this,0)" style="font-size:10px;font-weight: 300;" class="form-control">
                                   <option value="{tsUrl('duty','sum',array('groupid'=>$groupid,'begintime'=>$begintime,'endtime'=>$endtime,'addyear'=>$addyear,'page'=>$page))}">所有机构</option>
                                   {loop $strOrg $key $item}
                                   <option value="{tsUrl('duty','sum',array('groupid'=>$groupid,'orgid'=>$item['orgid'],'begintime'=>$begintime,'endtime'=>$endtime,'addyear'=>$addyear,'page'=>$page))}" {if $orgid==$item['orgid']}selected{/if}>{$item['orgname']}</option>
                                   {/loop}
                               </select>
                           </li>

                           <li style="padding-right: 2px">
                               <input class="form-control" name="begintime" readonly value="{if $begintime} {$begintime}{/if}"  id="beginTime" placeholder="开始时间"/>
                           </li>

                           <li style="padding-right: 2px">
                               <input class="form-control" name="endtime" readonly value="{if $endtime} {$endtime}{/if}" id="endTime" placeholder="结束时间"/>
                           </li>
                         <li style="padding-right: 2px">
                             <select onChange="MM_jumpMenu('parent',this,0)" style="font-size:10px;font-weight: 300;" class="form-control">
                                 <option value="{tsUrl('duty','sum',array('groupid'=>$groupid,'begintime'=>$begintime,'endtime'=>$endtime,'page'=>$page))}">注册年度</option>
                                 <!--{for $i=date('Y');$i>=2017;$i--}-->
                                 <option value="{tsUrl('duty','sum',array('groupid'=>$groupid,'orgid'=>$orgid,'begintime'=>$begintime,'endtime'=>$endtime,'addyear'=>$i,'page'=>$page))}" {if $addyear==$i}selected{/if}>{$i}</option>
                                 <!--{/for}-->
                             </select>
                         </li>

                         <li>
                           <input class="btn btn-group-sm" type="submit" value="查询">
                         </li>
                     </ul>
                </form>
                <h3 style="padding: 20px 0 10px 0px;text-align: center;" onclick="openform()">
                  <div style="font-weight: 500">{$title}</div><br/><span class="menu">人数合计：{$dutyNum}&nbsp;&nbsp;次数合计：{$countNum}&nbsp;&nbsp;时长合计：{$sumNum}</span>

                </h3>
                <div class="duty_index_list" style="padding-left: 20px">

                    {if $strDuty}
                    <table width="100%" class="menu">
                        <tr style="height: 30px;">
                        <td width="20%">姓名</td><td width="20%">时长</td><td width="20%">次数</td><td width="20%">所属团队</td> <td width="20%">等级</td>
                        </tr>


                        {loop $strDuty $key $item}
                            <tr style="height: 30px">
                           <td width="20%"><a href="{tsUrl('user','duty',array('id'=>$item[user][userid]))}"> {$item[user][username]}</a></td>
                           <td width="20%">{$item[sums]}</td>
                           <td width="20%">{$item[counts]}</td>
                           <td width="20%"><a href="#"  id="tips{php echo intval($key+1)}"  rel="popover" data-placement="auto left" data-content="{$item[user]['groupname']}" >{php echo cututf8($item[user]['groupname'],0,5)} </a></td>

                             <td width="20%">{$item[user][rolename]}</td>

                         </tr>
                        {/loop}

                        </table>
                    {else}
                    <div>没有记录</div>
                    {/if}
                    <div class="page">{$pageUrl}</div>
                </div>
            </div>

    </div>
    </div>
</div>
</div>

<script>
    $('#beginTime').datetimepicker({
        language:  'zh-CN',
        format: 'yyyy-mm-dd',
        autoclose: true,
        minView:2
    });

    $('#endTime').datetimepicker({
        language:  'zh-CN',
        format: 'yyyy-mm-dd',
        autoclose: true,
        minView:2
    });
</script>

{template footer}